<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    protected function getWXGzhConfig(){
        $config = [
            'app_id' => 'wx1efd2dd14890d6b6',
            'secret' => '1376bbf30bd8257c34f535a4ce63a6b6',
            'response_type' => 'array',
        ];

        return $config;
    }

    protected function getWxAppConfig()
    {
        $config = [
            'app_id' => config('wx.app_id'),
            'secret' => config('wx.secret'),
            'response_type' => 'array',
        ];

        return $config;
    }

    protected function getWxAppPayConfig()
    {
        $config = $this->getWxAppConfig();
        $config['mch_id'] = config('wx.mch_id');
        $config['key'] = config('wx.pay_api_key');
        $config['cert_path'] = storage_path('app/cert/1486527942/apiclient_cert.pem');
        $config['key_path'] = storage_path('app/cert/1486527942/apiclient_key.pem');
        $config['notify_url'] = 'http://s.yundocs.cn' . route('xcx_wx_pay', [], false);

        return $config;
    }
}
